<!DOCTYPE html>
<html>
<head>
	<title>登录</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	<style type="text/css">
	body center{
		width:1366px;
		height:768px;
		background:url(201.jpg);
		background-size:100% 100%;
		margin:0 auto;
	}	
    center{
       padding-top:60px;
	}	   
	</style>
</head>
<body>
<?php
echo  "<center>";
echo "欢迎使用智能考试系统！<p>";
if (null==($_COOKIE["user"] OR $_COOKIE["user"]==" "))
{
	echo "你还没有登录!<p>";
	echo "<a href='login_l.php'>登录</a> &nbsp;&nbsp;&nbsp;<a href='reg_l.php'>注册</a>";
}
else
{
	$user=$_COOKIE["user"];
	echo "查看用户".$user."的考试安排<p>";
	include "config.php";
	$sql="select *from anpai";
	$result=$mysqli->query($sql) or die ($mysqli->error);
	if(($num=$result->num_rows)==0)
	{
		 echo "还没有用户的考试安排";
	}
	else
	{
		echo "共有".$num."个考试安排";
		echo "<p>";
		echo "<table>";
		echo "<tr><td>考试班级</td><td>考试科目</td><td>考试时间</td><td>考试地点</td><td>监考老师</td></tr>";
		while( $row=$result->fetch_array())
		{
				echo "<tr>";
				echo "<td>".$row["class"]."</td>";
				echo "<td>".$row["name"]."</td>";
				echo "<td>".$row["time"]."</td>";
				echo "<td>".$row["kaochang"]."</td>";
				echo "<td>".$row["teacher"]."</td>";
				echo "</tr>";
		}
		echo "</table>";
	}
	echo "<a href=index.php><big><b>返回</big></b></a>";
	echo "</center>";
}
?>
</body>
</html>